package com.jzcn.common.constants;


public class UserConstants {

    /**
     * 超级管理员ID
     */
    public static final int SUPER_ADMIN = 1;

    public static final String USER_TOKEN = "Authorization";

    /**
     * 存放在redis中的access token头
     */
    public static final String REDIS_ACCESS_TOKEN_PREFIX = "access_token:user_name";

    public static final String USER_KEY = "userId";

    public static final int EXPIRE = 86400;

    /**
     * 用户名长度限制
     */
    public static final int USERNAME_MIN_LENGTH = 2;

    public static final int USERNAME_MAX_LENGTH = 20;

    public static final int COMMENT_MAX_LENGTH = 20;

    /**
     * 登录名称是否唯一的返回结果码
     */
    public static final String USER_NAME_UNIQUE = "0";

    public static final String USER_NAME_NOT_UNIQUE = "1";

    /**
     * 手机号码是否唯一的返回结果
     */
    public static final String USER_PHONE_UNIQUE = "0";

    public static final String USER_PHONE_NOT_UNIQUE = "1";

    /**
     * e-mail 是否唯一的返回结果
     */
    public static final String USER_EMAIL_UNIQUE = "0";

    public static final String USER_EMAIL_NOT_UNIQUE = "1";

    /**
     * 角色名称是否唯一的返回结果码
     */
    public static final String ROLE_NAME_UNIQUE = "0";

    public static final String ROLE_NAME_NOT_UNIQUE = "1";

    /**
     * 角色权限是否唯一的返回结果码
     */
    public static final String ROLE_KEY_UNIQUE = "0";

    public static final String ROLE_KEY_NOT_UNIQUE = "1";

    /**
     * 岗位编码是否唯一的返回结果码
     */
    public static final String POST_CODE_UNIQUE = "0";

    public static final String POST_CODE_NOT_UNIQUE = "1";

    /**
     * 菜单名称是否唯一的返回结果码
     */
    public static final String MENU_NAME_UNIQUE = "0";

    public static final String MENU_NAME_NOT_UNIQUE = "1";

    /**
     * 密码长度限制
     */
    public static final int PASSWORD_MIN_LENGTH = 5;

    public static final int PASSWORD_MAX_LENGTH = 20;

    /**
     * 手机号码格式限制
     */
    public static final String MOBILE_PHONE_NUMBER_PATTERN =
            "^[1](([3|5|8][\\\\d])|([4][4,5,6,7,8,9])|([6][2,5,6,7])|([7][^9])|([9][1,8,9]))[\\\\d]{8}$";

    /**
     * 邮箱格式限制
     */
    public static final String EMAIL_PATTERN =
            "^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?";

    /**
     * 存放在redis中的access token头
     */
    public static final String REDIS_CODE_PREFIX = "code:category";

    /**
     * 存放在redis中的标签列表
     */
    public static final String REDIS_TAG_LIST_PREFIX = "user:info";

    /**
     * 密码锁定时间 单位 秒  600s = 10分钟
     */
    public static final Integer PWD_LOCK_MINUTE = 600;
    /**
     * 密码锁定次数 10次
     */
    public static final Integer PWD_LOCK_COUNT = 10;

    /**
     * 系统管理员角色标识
     */
    public static final String SYSTEM_ADMIN_ROLE = "admin";
}
